package com.fadadianqi.logistics.sell.service;

import com.fadadianqi.logistics.customer.model.Customer;

import java.util.List;

/**
 * 打印在单据上的内容
 *
 * @author aroot
 */
public class PrintContent {

    private String title; // 标题
    private String time; // 打印时间
    private String memo; // 备注
    private String tel; // 电话
    private String fax; // 传真
    private String address; // 地址
    private String thanks; // 谢谢惠顾
    private Customer customer;
    private Double payables; // 应付账款
    private Double realPayables; // 打折后实际付款
    private List<PGoods> pgoodsList;

    private String staffName; // 开单人员名称

    public String getStaffName() {
        return staffName;
    }

    public void setStaffName(String staffName) {
        this.staffName = staffName;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getFax() {
        return fax;
    }

    public void setFax(String fax) {
        this.fax = fax;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getThanks() {
        return thanks;
    }

    public void setThanks(String thanks) {
        this.thanks = thanks;
    }

    public Customer getCustomer() {
        return customer;
    }

    public void setCustomer(Customer customer) {
        this.customer = customer;
    }

    public Double getPayables() {
        return payables;
    }

    public void setPayables(Double payables) {
        this.payables = payables;
    }

    public Double getRealPayables() {
        return realPayables;
    }

    public void setRealPayables(Double realPayables) {
        this.realPayables = realPayables;
    }

    public List<PGoods> getPgoodsList() {
        return pgoodsList;
    }

    public void setPgoodsList(List<PGoods> pgoodsList) {
        this.pgoodsList = pgoodsList;
    }

    public static class PGoods {

        private String brandName;
        private String categoryName;
        private String goodsName; // 商品型号
        private String goodsDisplayName; // 票据打印商品名
        private double price = 0; // 商品单价
        private int count = 1; // 购买数量
        private Double sumPrice; // 单个商品价格汇总

        public Double getSumPrice() {
            if (sumPrice == null) {
                return this.sumPrice = price * count;
            } else {
                return sumPrice;
            }
        }

        public void setSumPrice(double sumPrice) {
            this.sumPrice = sumPrice;
        }

        public String getBrandName() {
            return brandName;
        }

        public void setBrandName(String brandName) {
            this.brandName = brandName;
        }

        public String getCategoryName() {
            return categoryName;
        }

        public void setCategoryName(String categoryName) {
            this.categoryName = categoryName;
        }

        public String getGoodsName() {
            return goodsName;
        }

        public void setGoodsName(String goodsName) {
            this.goodsName = goodsName;
        }

        public String getGoodsDisplayName() {
            return goodsDisplayName;
        }

        public void setGoodsDisplayName(String goodsDisplayName) {
            this.goodsDisplayName = goodsDisplayName;
        }

        public double getPrice() {
            return price;
        }

        public void setPrice(double price) {
            this.price = price;
        }

        public int getCount() {
            return count;
        }

        public void setCount(int count) {
            this.count = count;
        }
    }
}
